@use '../abstracts/variables' as *;

.card {
    perspective: 150rem; //透视距离？
    position: relative;
    height: 52rem;

    &__side {
        height: 52rem;
        transition: all .8s ease;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        backface-visibility: hidden; //翻转的时候需要设置背面不可见
        border-radius: 3px;
        box-shadow: 0 1.5rem 4rem rgba($color-black, .15);
        overflow: hidden;

        &--front {
            // background-color: orangered;
        }

        &--back {
            transform: rotateY(180deg);

            &-1 {
                background-image: linear-gradient(to right bottom, $color-secondary-light, $color-secondary-dark);
            }

            &-2 {
                background-image: linear-gradient(to right bottom, $color-primary-light, $color-primary-dark);
            }

            &-3 {
                background-image: linear-gradient(to right bottom, $color-tertiary-light, $color-tertiary-dark);
            }
        }
    }

    &:hover &__side--front {
        transform: rotateY(-180deg);
    }

    &:hover &__side--back {
        transform: rotateY(0deg);
    }


    &__picture {
        background-size: cover;
        height: 23rem;
        background-blend-mode: screen;
        clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);

        &--1 {
            background-image: linear-gradient(to right bottom, $color-secondary-light, $color-secondary-dark), url(../img/nat-5.jpg);
        }

        &--2 {
            background-image: linear-gradient(to right bottom, $color-primary-light, $color-primary-dark), url(../img/nat-6.jpg);
        }

        &--3 {
            background-image: linear-gradient(to right bottom, $color-tertiary-light, $color-tertiary-dark), url(../img/nat-7.jpg);
        }
    }

    &__heading {
        font-size: 2.8rem;
        font-weight: 300;
        text-transform: uppercase;
        color: $color-white;
        position: absolute;
        top: 12rem;
        right: 2rem;
        width: 50%;
    }

    &__heading-span {
        text-align: right;
        padding: 1rem 1.5rem;
        box-decoration-break: clone; //设置行内元素分行显示时样式如何继承
        -webkit-box-decoration-break: clone;

        &--1 {
            background-image: linear-gradient(to right bottom, rgba($color-secondary-light, .85), rgba($color-secondary-dark, 0.85));
        }

        &--2 {
            background-image: linear-gradient(to right bottom, rgba($color-primary-light, .85), rgba($color-primary-dark, 0.85));
        }

        &--3 {
            background-image: linear-gradient(to right bottom, rgba($color-tertiary-light, .85), rgba($color-tertiary-dark, 0.85));
        }
    }

    &__details {
        padding: 3rem;

        // align-items: center;  这个属性不生效是因为改布局没有宽度，而且他的父布局也没有设置宽度，所以在这里设置居中是不生效的
        ul {
            list-style: none;
            width: 80%;
            margin: 0 auto; //可以通过这个方式设置居中，尤其是在父布局没有宽度的情况下

            li {
                text-align: center;
                font-size: 1.5rem;
                color: $color-black;
                padding: 1rem;

                &:not(:last-child) {
                    border-bottom: 1px solid $color-grey-light-2;
                }
            }
        }
    }

    &__cta {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
    }

    &__price {
        margin-bottom: 10rem;
        color: $color-white;
        text-align: center;
        &-only {
            font-size: 1.4rem;
        }
        &-value {
            font-size: 8rem;
            font-weight: 500;
        }
    }
}